[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
BSF Bit Scan Forward (386) Flags: O D I T S Z A P C
*
BSF destination, source
Logic: if a set bit is found in source
ZF . 1
destination . bit index of first set bit
else
ZF . 0
This instruction scans an operand for the first set bit. BSF scans
forward and BSR scans backwards. If a set bit (i.e. a bit that is 1) is
found in source, then the bit's index is placed in destination.
--------------------------------------------------------------------------
Operands Clocks Transfers Bytes Example
BSF register, register - 3 BSF AX, DX
BSF register, memory - 3 BSF AX, MEMLOC5
--------------------------------------------------------------------------
Note: Both registers and memory locations can be either
16 bits or 32 bits, but they must be the same length if
used in the same instruction.
See Also:
BSR
BT
BTC
BTR
BTS
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson